#include <bits/stdc++.h>
using namespace std;

int main() {
    // read data
    const int MOD = 998244353;
    int n, x;

    cin >> n >> x;

    int d[n], e[n];
    for (int i = 0; i < n; i++) {
        cin >> d[i];
        e[i] = i == 0 ? d[i] : e[i - 1] + d[i];
    }

    cout << "e= ";
    for (int i = 0; i < n; i++)
        cout << e[i] << " \n"[i == n - 1];

    int res = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < i; j++) {
            res = max(res, max(e[i] - e[j], e[i]));
        }
    }

    cout << res << endl;

    return 0;
}